<template>
    <div class=''>
        <div v-if="isShow">
            <div class="content">
                <list-message v-if="playVideoFlag == 'list'" :sendData="sendData" @toMessageDetail="toMessageHandler"></list-message>
                <circleMessage :sendData="sendData" v-else></circleMessage>
            </div>
            <div class="footer">
                <div class="footer_left" :class="{ 'blue': playVideoFlag == 'list' }" @click="listHandler">
                    <i class="el-icon-chat-dot-round" style="font-size: 24px;"></i>
                    <div style="font-size: 14px;font-weight: 900;">消息</div>
                </div>
                <div class="footer_right" :class="{ 'blue': playVideoFlag == 'my' }" @click="myHandler">
                    <i class="el-icon-mobile-phone" style="font-size: 24px;"></i>
                    <div style="font-size: 14px;font-weight: 900;">动态</div>
                </div>
            </div>
        </div>
        <div v-else>
            <messageDetail :sendData="sendData" :id="id" @edit='editHandler'></messageDetail>
        </div>
    </div>
</template>

<script>
import listMessage from './listMessage'
import circleMessage from './circleMessage'
import messageDetail from './messageDetail'
export default {
    name: 'huYou',
    props: ['sendData'],
    data() {
        return {
            playVideoFlag: 'list',//控制listMessage 和 circleMessage 的显隐
            isShow:true,
            id:''
        };
    },
    components: {
        listMessage,
        circleMessage,
        messageDetail,
    },
    created() {

    },
    mounted() {

    },
    methods: {
        //点击消息图标触发的回调
        listHandler() {
            this.playVideoFlag = 'list';
        },
        //点击我的图标触发的回调
        myHandler() {
            this.playVideoFlag = 'my';
        },
        toMessageHandler(id){
            this.isShow = false
            this.id = id
        },
        //返回
        editHandler(){
            this.isShow = true
        }
    },
};
</script>

<style lang='scss' scoped>

.blue {
    color: #3072f3;
}

.content {
    height: 822px;
    overflow-y: hidden;
    overflow-x: hidden;
}
@media screen and (min-width: 2360px) {
    .content{
        height: 778px;
    }
}

@media screen and (min-width: 2561px) {
    .content{
        height: 642px;
    }
}

.footer {
    height: 50px;
    border-top: 1px solid #e4e4e4;
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    cursor: pointer;

    .footer_left {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

</style>